import request from '@/axios'
import { SysApiLogDetailVo, SysApiLogEditQo, SysApiLogListVo, SysApiLogSearchQo } from './types'
import { BaseDeleteQo } from '@/base/api/BaseQo'

export const sysApiLogPageApi = (
  data: SysApiLogSearchQo
): Promise<IResponse<Array<SysApiLogListVo>>> => {
  return request.post({ url: '/sysApiLog/page.adw', data })
}

export const sysApiLogDetailApi = (id: number): Promise<IResponse<SysApiLogDetailVo>> => {
  const data = { id }
  return request.post({
    url: '/sysApiLog/detail.adw',
    data
  })
}

export const sysApiLogAddApi = (data: SysApiLogEditQo): Promise<IResponse<number>> => {
  return request.post({ url: '/sysApiLog/add.adw', data })
}

export const sysApiLogUpdateApi = (data: SysApiLogEditQo): Promise<IResponse<void>> => {
  return request.post({ url: '/sysApiLog/update.adw', data })
}

export const sysApiLogDeleteApi = (data: BaseDeleteQo): Promise<IResponse<void>> => {
  return request.post({ url: '/sysApiLog/delete.adw', data })
}

export const sysApiLogExportApi = (data: SysApiLogSearchQo): Promise<IResponse<void>> => {
  return request.post({ url: '/sysApiLog/export.adw', data })
}

// [[ OnflowGenerator Range (- selectFunctions -) Start ]]

// [[ OnflowGenerator Range (- selectFunctions -) End ]]
